<?php

namespace app\pc\controller;
use app\base\controller\Base;
use think\Request;
use think\Cache;
use think\Config;
use think\Session;


// 修改交易密码
class Record extends Base
{
    public  $model;
    public function __construct()
    {
        $this->model = model("OrderDetails");
        parent::__construct();
        $this->BaseWhere = ['a.user_id'=>$this->sidRows['id']];
        $this->BaseWhereNoa = ['user_id'=>$this->sidRows['id']];
    }

    /**
     *  开仓记录
     */
    public function open(){
        $where['a.status'] = ['in','1,2,3'];
        // 2持仓中 3卖出
        return $this->baseIndex($where);
    }
    /**
     *  平仓记录
     */
    public function close(){
        $where['a.status'] = ['in','3'];
        // 2持仓中 3卖出
        return $this->baseIndex($where);
    }

    /**
     *  废单
     */
    public function crippled(){
        $where['a.status'] = ['in','4'];
        // 2持仓中 3卖出
      return $this->baseIndex($where);
    }

    /**
     * @return \think\response\Json 开仓委托
     */
    public function wtopen(){
        $where['a.status'] =[['=',1],['=',0],'or'];
        // 2持仓中 3卖出
        return $this->baseIndex($where);

    }


    //a.status = 1 or a.status =0 or a.is_sell_status = 1 or a.is_sell_status =2
    /**
     * @return \think\response\Json 平仓委托
     */
    public function wtclose(){
        //$where['a.status'] = ["=",[1,0],'OR'];
        $where['a.is_sell_status'] =[['=',1],['=',2],'or'];

        // 2持仓中 3卖出
        return $this->baseIndex($where);

    }



}
